/**
 * 
 * @Project HRL Simulation
 * @Date 20.06.2011
 * @Author Aebi Pascal, Kocher Marc, Sriranjan George
 * @School BFH-TI Biel, Projekt 1
 *
 */

package utils;

import javax.swing.filechooser.FileFilter;
import java.io.*;

/**
 * A class that implements the Java FileFilter interface.
 */
public class HRLFileFilter extends FileFilter{

	private String sFileExtension = "hrl";
	private String sFileDesc = "HRL property file (."+ sFileExtension + ")";

	
	@Override
	public boolean accept(File f) {
		if(f.isDirectory()){
			return true;
		}
		else if(f.getAbsolutePath().toLowerCase().endsWith(this.sFileExtension)){
			return true;
		}
		else{
			return false;
		}
	}

	
	@Override
	public String getDescription() {
		return this.sFileDesc;
	}

	
	/**
	 * get the file extension
	 * @return file extension
	 */
	public String getFileExtension() {
		return sFileExtension;
	}
}
